var Version = {
    Major: 8,
    Minor: 0
};
var Const = {
    FrameMethod: 1,
    FrameHeader: 2,
    FrameBody: 3,
    FrameOobMethod: 4,
    FrameOobHeader: 5,
    FrameOobBody: 6,
    FrameTrace: 7,
    FrameHeartbeat: 8,
    FrameMinSize: 4096,
    FrameEnd: 206,
    ReplySuccess: 200,
    NotDelivered: 310,
    ContentTooLarge: 311,
    ConnectionForced: 320,
    InvalidPath: 402,
    AccessRefused: 403,
    NotFound: 404,
    ResourceLocked: 405,
    FrameError: 501,
    SyntaxError: 502,
    CommandInvalid: 503,
    ChannelError: 504,
    ResourceError: 506,
    NotAllowed: 530,
    NotImplemented: 540,
    InternalError: 541
};
var Class = {
    10: {
        /** @ignore */
        toString: function(){ return 'Connection'; },
        10: {
            /** @ignore */
            toString: function(){ return 'Start'; },
            enum: ['versionMajor', 'versionMinor', 'serverProperties', 'mechanisms', 'locales'],
            type: ['octet', 'octet', 'table', 'longstr', 'longstr']
        },
        11: {
            /** @ignore */
            toString: function(){ return 'StartOk'; },
            enum: ['clientProperties', 'mechanism', 'response', 'locale'],
            type: ['table', 'shortstr', 'longstr', 'shortstr']
        },
        20: {
            /** @ignore */
            toString: function(){ return 'Secure'; },
            enum: ['challenge'],
            type: ['longstr']
        },
        21: {
            /** @ignore */
            toString: function(){ return 'SecureOk'; },
            enum: ['response'],
            type: ['longstr']
        },
        30: {
            /** @ignore */
            toString: function(){ return 'Tune'; },
            enum: ['channelMax', 'frameMax', 'heartbeat'],
            type: ['short', 'long', 'short']
        },
        31: {
            /** @ignore */
            toString: function(){ return 'TuneOk'; },
            enum: ['channelMax', 'frameMax', 'heartbeat'],
            type: ['short', 'long', 'short']
        },
        40: {
            /** @ignore */
            toString: function(){ return 'Open'; },
            enum: ['virtualHost', 'capabilities', 'insist'],
            type: ['shortstr', 'shortstr', 'bit']
        },
        41: {
            /** @ignore */
            toString: function(){ return 'OpenOk'; },
            enum: ['knownHosts'],
            type: ['shortstr']
        },
        50: {
            /** @ignore */
            toString: function(){ return 'Redirect'; },
            enum: ['host', 'knownHosts'],
            type: ['shortstr', 'shortstr']
        },
        60: {
            /** @ignore */
            toString: function(){ return 'Close'; },
            enum: ['replyCode', 'replyText', 'classId', 'methodId'],
            type: ['short', 'shortstr', 'short', 'short']
        },
        61: {
            /** @ignore */
            toString: function(){ return 'CloseOk'; },
            enum: [],
            type: []
        }
    },
    20: {
        /** @ignore */
        toString: function(){ return 'Channel'; },
        10: {
            /** @ignore */
            toString: function(){ return 'Open'; },
            enum: ['outOfBand'],
            type: ['shortstr']
        },
        11: {
            /** @ignore */
            toString: function(){ return 'OpenOk'; },
            enum: [],
            type: []
        },
        20: {
            /** @ignore */
            toString: function(){ return 'Flow'; },
            enum: ['active'],
            type: ['bit']
        },
        21: {
            /** @ignore */
            toString: function(){ return 'FlowOk'; },
            enum: ['active'],
            type: ['bit']
        },
        30: {
            /** @ignore */
            toString: function(){ return 'Alert'; },
            enum: ['replyCode', 'replyText', 'details'],
            type: ['short', 'shortstr', 'table']
        },
        40: {
            /** @ignore */
            toString: function(){ return 'Close'; },
            enum: ['replyCode', 'replyText', 'classId', 'methodId'],
            type: ['short', 'shortstr', 'short', 'short']
        },
        41: {
            /** @ignore */
            toString: function(){ return 'CloseOk'; },
            enum: [],
            type: []
        }
    },
    30: {
        /** @ignore */
        toString: function(){ return 'Access'; },
        10: {
            /** @ignore */
            toString: function(){ return 'Request'; },
            enum: ['realm', 'exclusive', 'passive', 'active', 'write', 'read'],
            type: ['shortstr', 'bit', 'bit', 'bit', 'bit', 'bit']
        },
        11: {
            /** @ignore */
            toString: function(){ return 'RequestOk'; },
            enum: ['ticket'],
            type: ['short']
        }
    },
    40: {
        /** @ignore */
        toString: function(){ return 'Exchange'; },
        10: {
            /** @ignore */
            toString: function(){ return 'Declare'; },
            enum: ['ticket', 'exchange', 'type', 'passive', 'durable', 'autoDelete', 'internal', 'nowait', 'arguments'],
            type: ['short', 'shortstr', 'shortstr', 'bit', 'bit', 'bit', 'bit', 'bit', 'table']
        },
        11: {
            /** @ignore */
            toString: function(){ return 'DeclareOk'; },
            enum: [],
            type: []
        },
        20: {
            /** @ignore */
            toString: function(){ return 'Delete'; },
            enum: ['ticket', 'exchange', 'ifUnused', 'nowait'],
            type: ['short', 'shortstr', 'bit', 'bit']
        },
        21: {
            /** @ignore */
            toString: function(){ return 'DeleteOk'; },
            enum: [],
            type: []
        }
    },
    50: {
        /** @ignore */
        toString: function(){ return 'Queue'; },
        10: {
            /** @ignore */
            toString: function(){ return 'Declare'; },
            enum: ['ticket', 'queue', 'passive', 'durable', 'exclusive', 'autoDelete', 'nowait', 'arguments'],
            type: ['short', 'shortstr', 'bit', 'bit', 'bit', 'bit', 'bit', 'table']
        },
        11: {
            /** @ignore */
            toString: function(){ return 'DeclareOk'; },
            enum: ['queue', 'messageCount', 'consumerCount'],
            type: ['shortstr', 'long', 'long']
        },
        20: {
            /** @ignore */
            toString: function(){ return 'Bind'; },
            enum: ['ticket', 'queue', 'exchange', 'routingKey', 'nowait', 'arguments'],
            type: ['short', 'shortstr', 'shortstr', 'shortstr', 'bit', 'table']
        },
        21: {
            /** @ignore */
            toString: function(){ return 'BindOk'; },
            enum: [],
            type: []
        },
        30: {
            /** @ignore */
            toString: function(){ return 'Purge'; },
            enum: ['ticket', 'queue', 'nowait'],
            type: ['short', 'shortstr', 'bit']
        },
        31: {
            /** @ignore */
            toString: function(){ return 'PurgeOk'; },
            enum: ['messageCount'],
            type: ['long']
        },
        40: {
            /** @ignore */
            toString: function(){ return 'Delete'; },
            enum: ['ticket', 'queue', 'ifUnused', 'ifEmpty', 'nowait'],
            type: ['short', 'shortstr', 'bit', 'bit', 'bit']
        },
        41: {
            /** @ignore */
            toString: function(){ return 'DeleteOk'; },
            enum: ['messageCount'],
            type: ['long']
        }
    },
    60: {
        fields: {
            enum: ['contentType', 'contentEncoding', 'headers', 'deliveryMode', 'priority', 'correlationId', 'replyTo', 'expiration', 'messageId', 'timestamp', 'type', 'userId', 'appId', 'clusterId'],
            type: ['shortstr', 'shortstr', 'table', 'octet', 'octet', 'shortstr', 'shortstr', 'shortstr', 'shortstr', 'timestamp', 'shortstr', 'shortstr', 'shortstr', 'shortstr']
        },
        /** @ignore */
        toString: function(){ return 'Basic'; },
        10: {
            /** @ignore */
            toString: function(){ return 'Qos'; },
            enum: ['prefetchSize', 'prefetchCount', 'global'],
            type: ['long', 'short', 'bit']
        },
        11: {
            /** @ignore */
            toString: function(){ return 'QosOk'; },
            enum: [],
            type: []
        },
        20: {
            /** @ignore */
            toString: function(){ return 'Consume'; },
            enum: ['ticket', 'queue', 'consumerTag', 'noLocal', 'noAck', 'exclusive', 'nowait'],
            type: ['short', 'shortstr', 'shortstr', 'bit', 'bit', 'bit', 'bit']
        },
        21: {
            /** @ignore */
            toString: function(){ return 'ConsumeOk'; },
            enum: ['consumerTag'],
            type: ['shortstr']
        },
        30: {
            /** @ignore */
            toString: function(){ return 'Cancel'; },
            enum: ['consumerTag', 'nowait'],
            type: ['shortstr', 'bit']
        },
        31: {
            /** @ignore */
            toString: function(){ return 'CancelOk'; },
            enum: ['consumerTag'],
            type: ['shortstr']
        },
        40: {
            /** @ignore */
            toString: function(){ return 'Publish'; },
            enum: ['ticket', 'exchange', 'routingKey', 'mandatory', 'immediate'],
            type: ['short', 'shortstr', 'shortstr', 'bit', 'bit']
        },
        50: {
            /** @ignore */
            toString: function(){ return 'Return'; },
            enum: ['replyCode', 'replyText', 'exchange', 'routingKey'],
            type: ['short', 'shortstr', 'shortstr', 'shortstr']
        },
        60: {
            /** @ignore */
            toString: function(){ return 'Deliver'; },
            enum: ['consumerTag', 'deliveryTag', 'redelivered', 'exchange', 'routingKey'],
            type: ['shortstr', 'longlong', 'bit', 'shortstr', 'shortstr']
        },
        70: {
            /** @ignore */
            toString: function(){ return 'Get'; },
            enum: ['ticket', 'queue', 'noAck'],
            type: ['short', 'shortstr', 'bit']
        },
        71: {
            /** @ignore */
            toString: function(){ return 'GetOk'; },
            enum: ['deliveryTag', 'redelivered', 'exchange', 'routingKey', 'messageCount'],
            type: ['longlong', 'bit', 'shortstr', 'shortstr', 'long']
        },
        72: {
            /** @ignore */
            toString: function(){ return 'GetEmpty'; },
            enum: ['clusterId'],
            type: ['shortstr']
        },
        80: {
            /** @ignore */
            toString: function(){ return 'Ack'; },
            enum: ['deliveryTag', 'multiple'],
            type: ['longlong', 'bit']
        },
        90: {
            /** @ignore */
            toString: function(){ return 'Reject'; },
            enum: ['deliveryTag', 'requeue'],
            type: ['longlong', 'bit']
        },
        100: {
            /** @ignore */
            toString: function(){ return 'Recover'; },
            enum: ['requeue'],
            type: ['bit']
        }
    },
    70: {
        fields: {
            enum: ['contentType', 'contentEncoding', 'headers', 'priority', 'replyTo', 'messageId', 'filename', 'timestamp', 'clusterId'],
            type: ['shortstr', 'shortstr', 'table', 'octet', 'shortstr', 'shortstr', 'shortstr', 'timestamp', 'shortstr']
        },
        /** @ignore */
        toString: function(){ return 'File'; },
        10: {
            /** @ignore */
            toString: function(){ return 'Qos'; },
            enum: ['prefetchSize', 'prefetchCount', 'global'],
            type: ['long', 'short', 'bit']
        },
        11: {
            /** @ignore */
            toString: function(){ return 'QosOk'; },
            enum: [],
            type: []
        },
        20: {
            /** @ignore */
            toString: function(){ return 'Consume'; },
            enum: ['ticket', 'queue', 'consumerTag', 'noLocal', 'noAck', 'exclusive', 'nowait'],
            type: ['short', 'shortstr', 'shortstr', 'bit', 'bit', 'bit', 'bit']
        },
        21: {
            /** @ignore */
            toString: function(){ return 'ConsumeOk'; },
            enum: ['consumerTag'],
            type: ['shortstr']
        },
        30: {
            /** @ignore */
            toString: function(){ return 'Cancel'; },
            enum: ['consumerTag', 'nowait'],
            type: ['shortstr', 'bit']
        },
        31: {
            /** @ignore */
            toString: function(){ return 'CancelOk'; },
            enum: ['consumerTag'],
            type: ['shortstr']
        },
        40: {
            /** @ignore */
            toString: function(){ return 'Open'; },
            enum: ['identifier', 'contentSize'],
            type: ['shortstr', 'longlong']
        },
        41: {
            /** @ignore */
            toString: function(){ return 'OpenOk'; },
            enum: ['stagedSize'],
            type: ['longlong']
        },
        50: {
            /** @ignore */
            toString: function(){ return 'Stage'; },
            enum: [],
            type: []
        },
        60: {
            /** @ignore */
            toString: function(){ return 'Publish'; },
            enum: ['ticket', 'exchange', 'routingKey', 'mandatory', 'immediate', 'identifier'],
            type: ['short', 'shortstr', 'shortstr', 'bit', 'bit', 'shortstr']
        },
        70: {
            /** @ignore */
            toString: function(){ return 'Return'; },
            enum: ['replyCode', 'replyText', 'exchange', 'routingKey'],
            type: ['short', 'shortstr', 'shortstr', 'shortstr']
        },
        80: {
            /** @ignore */
            toString: function(){ return 'Deliver'; },
            enum: ['consumerTag', 'deliveryTag', 'redelivered', 'exchange', 'routingKey', 'identifier'],
            type: ['shortstr', 'longlong', 'bit', 'shortstr', 'shortstr', 'shortstr']
        },
        90: {
            /** @ignore */
            toString: function(){ return 'Ack'; },
            enum: ['deliveryTag', 'multiple'],
            type: ['longlong', 'bit']
        },
        100: {
            /** @ignore */
            toString: function(){ return 'Reject'; },
            enum: ['deliveryTag', 'requeue'],
            type: ['longlong', 'bit']
        }
    },
    80: {
        fields: {
            enum: ['contentType', 'contentEncoding', 'headers', 'priority', 'timestamp'],
            type: ['shortstr', 'shortstr', 'table', 'octet', 'timestamp']
        },
        /** @ignore */
        toString: function(){ return 'Stream'; },
        10: {
            /** @ignore */
            toString: function(){ return 'Qos'; },
            enum: ['prefetchSize', 'prefetchCount', 'consumeRate', 'global'],
            type: ['long', 'short', 'long', 'bit']
        },
        11: {
            /** @ignore */
            toString: function(){ return 'QosOk'; },
            enum: [],
            type: []
        },
        20: {
            /** @ignore */
            toString: function(){ return 'Consume'; },
            enum: ['ticket', 'queue', 'consumerTag', 'noLocal', 'exclusive', 'nowait'],
            type: ['short', 'shortstr', 'shortstr', 'bit', 'bit', 'bit']
        },
        21: {
            /** @ignore */
            toString: function(){ return 'ConsumeOk'; },
            enum: ['consumerTag'],
            type: ['shortstr']
        },
        30: {
            /** @ignore */
            toString: function(){ return 'Cancel'; },
            enum: ['consumerTag', 'nowait'],
            type: ['shortstr', 'bit']
        },
        31: {
            /** @ignore */
            toString: function(){ return 'CancelOk'; },
            enum: ['consumerTag'],
            type: ['shortstr']
        },
        40: {
            /** @ignore */
            toString: function(){ return 'Publish'; },
            enum: ['ticket', 'exchange', 'routingKey', 'mandatory', 'immediate'],
            type: ['short', 'shortstr', 'shortstr', 'bit', 'bit']
        },
        50: {
            /** @ignore */
            toString: function(){ return 'Return'; },
            enum: ['replyCode', 'replyText', 'exchange', 'routingKey'],
            type: ['short', 'shortstr', 'shortstr', 'shortstr']
        },
        60: {
            /** @ignore */
            toString: function(){ return 'Deliver'; },
            enum: ['consumerTag', 'deliveryTag', 'exchange', 'queue'],
            type: ['shortstr', 'longlong', 'shortstr', 'shortstr']
        }
    },
    90: {

        /** @ignore */
        toString: function(){ return 'Tx'; },
        10: {
            /** @ignore */
            toString: function(){ return 'Select'; },
            enum: [],
            type: []
        },
        11: {
            /** @ignore */
            toString: function(){ return 'SelectOk'; },
            enum: [],
            type: []
        },
        20: {
            /** @ignore */
            toString: function(){ return 'Commit'; },
            enum: [],
            type: []
        },
        21: {
            /** @ignore */
            toString: function(){ return 'CommitOk'; },
            enum: [],
            type: []
        },
        30: {
            /** @ignore */
            toString: function(){ return 'Rollback'; },
            enum: [],
            type: []
        },
        31: {
            /** @ignore */
            toString: function(){ return 'RollbackOk'; },
            enum: [],
            type: []
        }
    },
    100: {

        /** @ignore */
        toString: function(){ return 'Dtx'; },
        10: {
            /** @ignore */
            toString: function(){ return 'Select'; },
            enum: [],
            type: []
        },
        11: {
            /** @ignore */
            toString: function(){ return 'SelectOk'; },
            enum: [],
            type: []
        },
        20: {
            /** @ignore */
            toString: function(){ return 'Start'; },
            enum: ['dtxIdentifier'],
            type: ['shortstr']
        },
        21: {
            /** @ignore */
            toString: function(){ return 'StartOk'; },
            enum: [],
            type: []
        }
    },
    110: {
        fields: {
            enum: ['headers', 'proxyName', 'dataName', 'durable', 'broadcast'],
            type: ['table', 'shortstr', 'shortstr', 'octet', 'octet']
        },
        /** @ignore */
        toString: function(){ return 'Tunnel'; },
        10: {
            /** @ignore */
            toString: function(){ return 'Request'; },
            enum: ['metaData'],
            type: ['table']
        }
    },
    120: {

        /** @ignore */
        toString: function(){ return 'Test'; },
        10: {
            /** @ignore */
            toString: function(){ return 'Integer'; },
            enum: ['integer1', 'integer2', 'integer3', 'integer4', 'operation'],
            type: ['octet', 'short', 'long', 'longlong', 'octet']
        },
        11: {
            /** @ignore */
            toString: function(){ return 'IntegerOk'; },
            enum: ['result'],
            type: ['longlong']
        },
        20: {
            /** @ignore */
            toString: function(){ return 'String'; },
            enum: ['string1', 'string2', 'operation'],
            type: ['shortstr', 'longstr', 'octet']
        },
        21: {
            /** @ignore */
            toString: function(){ return 'StringOk'; },
            enum: ['result'],
            type: ['longstr']
        },
        30: {
            /** @ignore */
            toString: function(){ return 'Table'; },
            enum: ['table', 'integerOp', 'stringOp'],
            type: ['table', 'octet', 'octet']
        },
        31: {
            /** @ignore */
            toString: function(){ return 'TableOk'; },
            enum: ['integerResult', 'stringResult'],
            type: ['longlong', 'longstr']
        },
        40: {
            /** @ignore */
            toString: function(){ return 'Content'; },
            enum: [],
            type: []
        },
        41: {
            /** @ignore */
            toString: function(){ return 'ContentOk'; },
            enum: ['contentChecksum'],
            type: ['long']
        }
    },
    Connection: {
        /** @ignore */
        toString: function(){ return 10; },
        /** @ignore */
        toValue: function(){ return 10; },
        Start: 10,
        StartOk: 11,
        Secure: 20,
        SecureOk: 21,
        Tune: 30,
        TuneOk: 31,
        Open: 40,
        OpenOk: 41,
        Redirect: 50,
        Close: 60,
        CloseOk: 61
    },
    Channel: {
        /** @ignore */
        toString: function(){ return 20; },
        /** @ignore */
        toValue: function(){ return 20; },
        Open: 10,
        OpenOk: 11,
        Flow: 20,
        FlowOk: 21,
        Alert: 30,
        Close: 40,
        CloseOk: 41
    },
    Access: {
        /** @ignore */
        toString: function(){ return 30; },
        /** @ignore */
        toValue: function(){ return 30; },
        Request: 10,
        RequestOk: 11
    },
    Exchange: {
        /** @ignore */
        toString: function(){ return 40; },
        /** @ignore */
        toValue: function(){ return 40; },
        Declare: 10,
        DeclareOk: 11,
        Delete: 20,
        DeleteOk: 21
    },
    Queue: {
        /** @ignore */
        toString: function(){ return 50; },
        /** @ignore */
        toValue: function(){ return 50; },
        Declare: 10,
        DeclareOk: 11,
        Bind: 20,
        BindOk: 21,
        Purge: 30,
        PurgeOk: 31,
        Delete: 40,
        DeleteOk: 41
    },
    Basic: {
        /** @ignore */
        toString: function(){ return 60; },
        /** @ignore */
        toValue: function(){ return 60; },
        Qos: 10,
        QosOk: 11,
        Consume: 20,
        ConsumeOk: 21,
        Cancel: 30,
        CancelOk: 31,
        Publish: 40,
        Return: 50,
        Deliver: 60,
        Get: 70,
        GetOk: 71,
        GetEmpty: 72,
        Ack: 80,
        Reject: 90,
        Recover: 100
    },
    File: {
        /** @ignore */
        toString: function(){ return 70; },
        /** @ignore */
        toValue: function(){ return 70; },
        Qos: 10,
        QosOk: 11,
        Consume: 20,
        ConsumeOk: 21,
        Cancel: 30,
        CancelOk: 31,
        Open: 40,
        OpenOk: 41,
        Stage: 50,
        Publish: 60,
        Return: 70,
        Deliver: 80,
        Ack: 90,
        Reject: 100
    },
    Stream: {
        /** @ignore */
        toString: function(){ return 80; },
        /** @ignore */
        toValue: function(){ return 80; },
        Qos: 10,
        QosOk: 11,
        Consume: 20,
        ConsumeOk: 21,
        Cancel: 30,
        CancelOk: 31,
        Publish: 40,
        Return: 50,
        Deliver: 60
    },
    Tx: {
        /** @ignore */
        toString: function(){ return 90; },
        /** @ignore */
        toValue: function(){ return 90; },
        Select: 10,
        SelectOk: 11,
        Commit: 20,
        CommitOk: 21,
        Rollback: 30,
        RollbackOk: 31
    },
    Dtx: {
        /** @ignore */
        toString: function(){ return 100; },
        /** @ignore */
        toValue: function(){ return 100; },
        Select: 10,
        SelectOk: 11,
        Start: 20,
        StartOk: 21
    },
    Tunnel: {
        /** @ignore */
        toString: function(){ return 110; },
        /** @ignore */
        toValue: function(){ return 110; },
        Request: 10
    },
    Test: {
        /** @ignore */
        toString: function(){ return 120; },
        /** @ignore */
        toValue: function(){ return 120; },
        Integer: 10,
        IntegerOk: 11,
        String: 20,
        StringOk: 21,
        Table: 30,
        TableOk: 31,
        Content: 40,
        ContentOk: 41
    }
};

exports.Amqp = {
    Version: Version,
    Const: Const,
    Class: Class
};
